<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta content="IE=edge" http-equiv="X-UA-Compatible">
    <title>{:sysconf('app_name')}</title>
    <link href="{:sysconf('browser_icon')}" rel="shortcut icon">
    <link href="__STATIC__/theme/css/login.css?v={:date('ymd')}" rel="stylesheet">

</head>
<body class="page-login-v3">
<div class="container">
    <div id="wrapper" class="login-body">
        <div class="login-content">
            <div class="brand">
                <img alt="logo" class="brand-img" src="">
                <h2 class="brand-text">{:sysconf('app_name')}</h2>
            </div>
            <form id="login-form" class="login-form" data-auto="true">

                <div class="form-group">
                    <input class="" name="username"  autofocus="autofocus" autocomplete="off" title="请输入4位及以上的字符" placeholder="请输入用户名" value="" type="text" >
                </div>
                <div class="form-group">
                    <input class="" name="password"  autocomplete="off" title="请输入4位及以上的字符" placeholder="请输入密码" value="" type="password" >
                </div>
                <div class="form-group">
                    <!--<button id="btn-submit" type="submit">-->
                    <!--登录-->
                    <!--</button>-->
                    <button type="submit" id="btn-submit"  class="layui-btn layui-disabled" data-form-loaded="正 在 载 入">立 即 登 入</button>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
<script src="__STATIC__/plugs/jquery/jquery.min.js"></script>
<script src="__STATIC__/plugs/layui/layui.all.js"></script>
<script src="__STATIC__/plugs/jquery/jquery.form.min.js"></script>
<script>
    $(function () {
        // 表单提交
        var $form = $('#login-form');
        $form.submit(function () {
            var $btn_submit = $('#btn-submit');
            $btn_submit.attr("disabled", true);
            $form.ajaxSubmit({
                type: "post",
                dataType: "json",
                 url: '/login/index',
                success: function (result) {
                    $btn_submit.attr('disabled', false);
                    if (result.code === 1) {
                        layer.msg(result.msg, {time: 1500, anim: 1}, function () {
                            window.location = result.url;
                        });
                        return true;
                    }
                    layer.msg(result.msg, {time: 1500, anim: 6});
                }
            });
            return false;
        });
    });
</script>
</html>
